/**
 *    Copyright (C) 2008, 2009  Victor Smirnov <aist11@gmail.com>
 *
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License along
 *    with this program; if not, write to the Free Software Foundation, Inc.,
 *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *    See LICENSE.exceptions in the root folder of this project for possible
 *    exceptions
 *
 */

#ifndef _CUBEFS_API_TOOLS_PLUGIN_HPP
#define	_CUBEFS_API_TOOLS_PLUGIN_HPP

#include <cubefs/api/reflection/type.hpp>
#include <cubefs/api/reflection/list.hpp>
#include <cubefs/api/tools/version.hpp>
#include <cubefs/api/tools/library.hpp>
#include <cubefs/api/tools/configurator.hpp>


namespace cubefs { namespace api {

struct CUBEFS_API Plugin: public Typed {
	virtual const Configuration* GetGonfiguration() const		= 0;
	virtual bool IsPropertyDefined(StringRef name) const		= 0;
	virtual String GetProperty(StringRef name) const			= 0;

	virtual String GetResourcePath() const 						= 0;
	virtual Version GetVersion() const 							= 0;
	virtual Version GetApiVersion() const 						= 0;

	virtual SharedLibrary& GetLibrary() 						= 0;


	static Plugin* FindPlugin(StringRef type, StringRef name, const Version& version, const Version& api_version);

	static Type* MyType();
};

CUBEFS_DECLARE_TYPENAME(Plugin, "cubefs::api::Plugin");

CUBEFS_API bool HasPlugins();

}}

#endif
